<!DOCTYPE html><html><head><meta charset="utf-8"><style>body {
  width: 70%;
  border: 1px solid #ddd;
  outline: 1300px solid #fff;
  margin: 16px auto;
}

body .markdown-body
{
  padding: 30px;
}

@font-face {
  font-family: fontawesome-mini;
  src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAzUABAAAAAAFNgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABbAAAABwAAAAcZMzaOEdERUYAAAGIAAAAHQAAACAAOQAET1MvMgAAAagAAAA+AAAAYHqhde9jbWFwAAAB6AAAAFIAAAFa4azkLWN2dCAAAAI8AAAAKAAAACgFgwioZnBnbQAAAmQAAAGxAAACZVO0L6dnYXNwAAAEGAAAAAgAAAAIAAAAEGdseWYAAAQgAAAFDgAACMz7eroHaGVhZAAACTAAAAAwAAAANgWEOEloaGVhAAAJYAAAAB0AAAAkDGEGa2htdHgAAAmAAAAAEwAAADBEgAAQbG9jYQAACZQAAAAaAAAAGgsICJBtYXhwAAAJsAAAACAAAAAgASgBD25hbWUAAAnQAAACZwAABOD4no+3cG9zdAAADDgAAABsAAAAmF+yXM9wcmVwAAAMpAAAAC4AAAAusPIrFAAAAAEAAAAAyYlvMQAAAADLVHQgAAAAAM/u9uZ4nGNgZGBg4ANiCQYQYGJgBEJuIGYB8xgABMMAPgAAAHicY2Bm42OcwMDKwMLSw2LMwMDQBqGZihmiwHycoKCyqJjB4YPDh4NsDP+BfNb3DIuAFCOSEgUGRgAKDgt4AAB4nGNgYGBmgGAZBkYGEAgB8hjBfBYGCyDNxcDBwMTA9MHhQ9SHrA8H//9nYACyQyFs/sP86/kX8HtB9UIBIxsDXICRCUgwMaACRoZhDwA3fxKSAAAAAAHyAHABJQB/AIEAdAFGAOsBIwC/ALgAxACGAGYAugBNACcA/wCIeJxdUbtOW0EQ3Q0PA4HE2CA52hSzmZDGe6EFCcTVjWJkO4XlCGk3cpGLcQEfQIFEDdqvGaChpEibBiEXSHxCPiESM2uIojQ7O7NzzpkzS8qRqn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fgF0r/zJQB4nG2JUQuCQBCEd07TTg36fb2IyBaLd3vWaUh/vmSJnvpgmG8YcmS8X3Shf3R7QA4OBUocUKHGER5NNbOOEvwc1txnuWkTRb/aPjimJ5vXabI+3VfOiyS15UWvyezM2xiGOPyuMohOH8O8JiO4Af+FsAGNAEuwCFBYsQEBjlmxRgYrWCGwEFlLsBRSWCGwgFkdsAYrXFhZsBQrAAA=) format('woff');
}

@font-face {
  font-family: octicons-anchor;
  src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAYcAA0AAAAACjQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca8vGTk9TLzIAAAFMAAAARAAAAFZG1VHVY21hcAAAAZAAAAA+AAABQgAP9AdjdnQgAAAB0AAAAAQAAAAEACICiGdhc3AAAAHUAAAACAAAAAj//wADZ2x5ZgAAAdwAAADRAAABEKyikaNoZWFkAAACsAAAAC0AAAA2AtXoA2hoZWEAAALgAAAAHAAAACQHngNFaG10eAAAAvwAAAAQAAAAEAwAACJsb2NhAAADDAAAAAoAAAAKALIAVG1heHAAAAMYAAAAHwAAACABEAB2bmFtZQAAAzgAAALBAAAFu3I9x/Nwb3N0AAAF/AAAAB0AAAAvaoFvbwAAAAEAAAAAzBdyYwAAAADP2IQvAAAAAM/bz7t4nGNgZGFgnMDAysDB1Ml0hoGBoR9CM75mMGLkYGBgYmBlZsAKAtJcUxgcPsR8iGF2+O/AEMPsznAYKMwIkgMA5REMOXicY2BgYGaAYBkGRgYQsAHyGMF8FgYFIM0ChED+h5j//yEk/3KoSgZGNgYYk4GRCUgwMaACRoZhDwCs7QgGAAAAIgKIAAAAAf//AAJ4nHWMMQrCQBBF/0zWrCCIKUQsTDCL2EXMohYGSSmorScInsRGL2DOYJe0Ntp7BK+gJ1BxF1stZvjz/v8DRghQzEc4kIgKwiAppcA9LtzKLSkdNhKFY3HF4lK69ExKslx7Xa+vPRVS43G98vG1DnkDMIBUgFN0MDXflU8tbaZOUk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1xHzTXRqgKzek/mb7nB8RZTCDhGEX3kK/8Q75AmUM/eLkfA+0Hi908Kx4eNsMgudg5GLdRD7a84npi+YxNr5i5KIbW5izXas7cHXIMAau1OueZhfj+cOcP3P8MNIWLyYOBuxL6DRylJ4cAAAB4nGNgYoAALjDJyIAOWMCiTIxMLDmZedkABtIBygAAAA==) format('woff');
}

.markdown-body {
  font-family: sans-serif;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  color: #333333;
  overflow: hidden;
  font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  word-wrap: break-word;
}

.markdown-body a {
  background: transparent;
}

.markdown-body a:active,
.markdown-body a:hover {
  outline: 0;
}

.markdown-body b,
.markdown-body strong {
  font-weight: bold;
}

.markdown-body mark {
  background: #ff0;
  color: #000;
  font-style: italic;
  font-weight: bold;
}

.markdown-body sub,
.markdown-body sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
.markdown-body sup {
  top: -0.5em;
}
.markdown-body sub {
  bottom: -0.25em;
}

.markdown-body h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

.markdown-body img {
  border: 0;
}

.markdown-body hr {
  -moz-box-sizing: content-box;
  box-sizing: content-box;
  height: 0;
}

.markdown-body pre {
  overflow: auto;
}

.markdown-body code,
.markdown-body kbd,
.markdown-body pre,
.markdown-body samp {
  font-family: monospace, monospace;
  font-size: 1em;
}

.markdown-body input {
  color: inherit;
  font: inherit;
  margin: 0;
}

.markdown-body html input[disabled] {
  cursor: default;
}

.markdown-body input {
  line-height: normal;
}

.markdown-body input[type="checkbox"] {
  box-sizing: border-box;
  padding: 0;
}

.markdown-body table {
  border-collapse: collapse;
  border-spacing: 0;
}

.markdown-body td,
.markdown-body th {
  padding: 0;
}

.markdown-body .codehilitetable {
  border: 0;
  border-spacing: 0;
}

.markdown-body .codehilitetable tr {
  border: 0;
}

.markdown-body .codehilitetable pre,
.markdown-body .codehilitetable div.codehilite {
  margin: 0;
}

.markdown-body .linenos,
.markdown-body .code,
.markdown-body .codehilitetable td {
  border: 0;
  padding: 0;
}

.markdown-body td:not(.linenos) .linenodiv {
  padding: 0 !important;
}

.markdown-body .code {
  width: 100%;
}

.markdown-body .linenos div pre,
.markdown-body .linenodiv pre,
.markdown-body .linenodiv {
  border: 0;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
  -webkit-border-top-left-radius: 3px;
  -webkit-border-bottom-left-radius: 3px;
  -moz-border-radius-topleft: 3px;
  -moz-border-radius-bottomleft: 3px;
  border-top-left-radius: 3px;
  border-bottom-left-radius: 3px;
}

.markdown-body .code div pre,
.markdown-body .code div {
  border: 0;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
  -webkit-border-top-right-radius: 3px;
  -webkit-border-bottom-right-radius: 3px;
  -moz-border-radius-topright: 3px;
  -moz-border-radius-bottomright: 3px;
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
}

.markdown-body * {
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.markdown-body input {
  font: 13px Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
  line-height: 1.4;
}

.markdown-body a {
  color: #4183c4;
  text-decoration: none;
}

.markdown-body a:hover,
.markdown-body a:focus,
.markdown-body a:active {
  text-decoration: underline;
}

.markdown-body hr {
  height: 0;
  margin: 15px 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #ddd;
}

.markdown-body hr:before,
.markdown-body hr:after {
  display: table;
  content: " ";
}

.markdown-body hr:after {
  clear: both;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin-top: 15px;
  margin-bottom: 15px;
  line-height: 1.1;
}

.markdown-body h1 {
  font-size: 30px;
}

.markdown-body h2 {
  font-size: 21px;
}

.markdown-body h3 {
  font-size: 16px;
}

.markdown-body h4 {
  font-size: 14px;
}

.markdown-body h5 {
  font-size: 12px;
}

.markdown-body h6 {
  font-size: 11px;
}

.markdown-body blockquote {
  margin: 0;
}

.markdown-body ul,
.markdown-body ol {
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.markdown-body ol ol,
.markdown-body ul ol {
  list-style-type: lower-roman;
}

.markdown-body ul ul ol,
.markdown-body ul ol ol,
.markdown-body ol ul ol,
.markdown-body ol ol ol {
  list-style-type: lower-alpha;
}

.markdown-body dd {
  margin-left: 0;
}

.markdown-body code,
.markdown-body pre,
.markdown-body samp {
  font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 12px;
}

.markdown-body pre {
  margin-top: 0;
  margin-bottom: 0;
}

.markdown-body kbd {
  background-color: #e7e7e7;
  background-image: -moz-linear-gradient(#fefefe, #e7e7e7);
  background-image: -webkit-linear-gradient(#fefefe, #e7e7e7);
  background-image: linear-gradient(#fefefe, #e7e7e7);
  background-repeat: repeat-x;
  border-radius: 2px;
  border: 1px solid #cfcfcf;
  color: #000;
  padding: 3px 5px;
  line-height: 10px;
  font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
  display: inline-block;
}

.markdown-body>*:first-child {
  margin-top: 0 !important;
}

.markdown-body>*:last-child {
  margin-bottom: 0 !important;
}

.markdown-body .headeranchor-link {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: block;
  padding-right: 6px;
  padding-left: 30px;
  margin-left: -30px;
}

.markdown-body .headeranchor-link:focus {
  outline: none;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  position: relative;
  margin-top: 1em;
  margin-bottom: 16px;
  font-weight: bold;
  line-height: 1.4;
}

.markdown-body h1 .headeranchor,
.markdown-body h2 .headeranchor,
.markdown-body h3 .headeranchor,
.markdown-body h4 .headeranchor,
.markdown-body h5 .headeranchor,
.markdown-body h6 .headeranchor {
  display: none;
  color: #000;
  vertical-align: middle;
}

.markdown-body h1:hover .headeranchor-link,
.markdown-body h2:hover .headeranchor-link,
.markdown-body h3:hover .headeranchor-link,
.markdown-body h4:hover .headeranchor-link,
.markdown-body h5:hover .headeranchor-link,
.markdown-body h6:hover .headeranchor-link {
  height: 1em;
  padding-left: 8px;
  margin-left: -30px;
  line-height: 1;
  text-decoration: none;
}

.markdown-body h1:hover .headeranchor-link .headeranchor,
.markdown-body h2:hover .headeranchor-link .headeranchor,
.markdown-body h3:hover .headeranchor-link .headeranchor,
.markdown-body h4:hover .headeranchor-link .headeranchor,
.markdown-body h5:hover .headeranchor-link .headeranchor,
.markdown-body h6:hover .headeranchor-link .headeranchor {
  display: inline-block;
}

.markdown-body h1 {
  padding-bottom: 0.3em;
  font-size: 2.25em;
  line-height: 1.2;
  border-bottom: 1px solid #eee;
}

.markdown-body h2 {
  padding-bottom: 0.3em;
  font-size: 1.75em;
  line-height: 1.225;
  border-bottom: 1px solid #eee;
}

.markdown-body h3 {
  font-size: 1.5em;
  line-height: 1.43;
}

.markdown-body h4 {
  font-size: 1.25em;
}

.markdown-body h5 {
  font-size: 1em;
}

.markdown-body h6 {
  font-size: 1em;
  color: #777;
}

.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre,
.markdown-body .admonition {
  margin-top: 0;
  margin-bottom: 16px;
}

.markdown-body hr {
  height: 4px;
  padding: 0;
  margin: 16px 0;
  background-color: #e7e7e7;
  border: 0 none;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 2em;
}

.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
  margin-top: 0;
  margin-bottom: 0;
}

.markdown-body li>p {
  margin-top: 16px;
}

.markdown-body dl {
  padding: 0;
}

.markdown-body dl dt {
  padding: 0;
  margin-top: 16px;
  font-size: 1em;
  font-style: italic;
  font-weight: bold;
}

.markdown-body dl dd {
  padding: 0 16px;
  margin-bottom: 16px;
}

.markdown-body blockquote {
  padding: 0 15px;
  color: #777;
  border-left: 4px solid #ddd;
}

.markdown-body blockquote>:first-child {
  margin-top: 0;
}

.markdown-body blockquote>:last-child {
  margin-bottom: 0;
}

.markdown-body table {
  display: block;
  width: 100%;
  overflow: auto;
  word-break: normal;
  word-break: keep-all;
}

.markdown-body table th {
  font-weight: bold;
}

.markdown-body table th,
.markdown-body table td {
  padding: 6px 13px;
  border: 1px solid #ddd;
}

.markdown-body table tr {
  background-color: #fff;
  border-top: 1px solid #ccc;
}

.markdown-body table tr:nth-child(2n) {
  background-color: #f8f8f8;
}

.markdown-body img {
  max-width: 100%;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.markdown-body code,
.markdown-body samp {
  padding: 0;
  padding-top: 0.2em;
  padding-bottom: 0.2em;
  margin: 0;
  font-size: 85%;
  background-color: rgba(0,0,0,0.04);
  border-radius: 3px;
}

.markdown-body code:before,
.markdown-body code:after {
  letter-spacing: -0.2em;
  content: "\00a0";
}

.markdown-body pre>code {
  padding: 0;
  margin: 0;
  font-size: 100%;
  word-break: normal;
  white-space: pre;
  background: transparent;
  border: 0;
}

.markdown-body .codehilite {
  margin-bottom: 16px;
}

.markdown-body .codehilite pre,
.markdown-body pre {
  padding: 16px;
  overflow: auto;
  font-size: 85%;
  line-height: 1.45;
  background-color: #f7f7f7;
  border-radius: 3px;
}

.markdown-body .codehilite pre {
  margin-bottom: 0;
  word-break: normal;
}

.markdown-body pre {
  word-wrap: normal;
}

.markdown-body pre code {
  display: inline;
  max-width: initial;
  padding: 0;
  margin: 0;
  overflow: initial;
  line-height: inherit;
  word-wrap: normal;
  background-color: transparent;
  border: 0;
}

.markdown-body pre code:before,
.markdown-body pre code:after {
  content: normal;
}

/* Admonition */
.markdown-body .admonition {
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  position: relative;
  border-radius: 3px;
  border: 1px solid #e0e0e0;
  border-left: 6px solid #333;
  padding: 10px 10px 10px 30px;
}

.markdown-body .admonition table {
  color: #333;
}

.markdown-body .admonition p {
  padding: 0;
}

.markdown-body .admonition-title {
  font-weight: bold;
  margin: 0;
}

.markdown-body .admonition>.admonition-title {
  color: #333;
}

.markdown-body .attention>.admonition-title {
  color: #a6d796;
}

.markdown-body .caution>.admonition-title {
  color: #d7a796;
}

.markdown-body .hint>.admonition-title {
  color: #96c6d7;
}

.markdown-body .danger>.admonition-title {
  color: #c25f77;
}

.markdown-body .question>.admonition-title {
  color: #96a6d7;
}

.markdown-body .note>.admonition-title {
  color: #d7c896;
}

.markdown-body .admonition:before,
.markdown-body .attention:before,
.markdown-body .caution:before,
.markdown-body .hint:before,
.markdown-body .danger:before,
.markdown-body .question:before,
.markdown-body .note:before {
  font: normal normal 16px fontawesome-mini;
  -moz-osx-font-smoothing: grayscale;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  line-height: 1.5;
  color: #333;
  position: absolute;
  left: 0;
  top: 0;
  padding-top: 10px;
  padding-left: 10px;
}

.markdown-body .admonition:before {
  content: "\f056\00a0";
  color: 333;
}

.markdown-body .attention:before {
  content: "\f058\00a0";
  color: #a6d796;
}

.markdown-body .caution:before {
  content: "\f06a\00a0";
  color: #d7a796;
}

.markdown-body .hint:before {
  content: "\f05a\00a0";
  color: #96c6d7;
}

.markdown-body .danger:before {
  content: "\f057\00a0";
  color: #c25f77;
}

.markdown-body .question:before {
  content: "\f059\00a0";
  color: #96a6d7;
}

.markdown-body .note:before {
  content: "\f040\00a0";
  color: #d7c896;
}

.markdown-body .admonition::after {
  content: normal;
}

.markdown-body .attention {
  border-left: 6px solid #a6d796;
}

.markdown-body .caution {
  border-left: 6px solid #d7a796;
}

.markdown-body .hint {
  border-left: 6px solid #96c6d7;
}

.markdown-body .danger {
  border-left: 6px solid #c25f77;
}

.markdown-body .question {
  border-left: 6px solid #96a6d7;
}

.markdown-body .note {
  border-left: 6px solid #d7c896;
}

.markdown-body .admonition>*:first-child {
  margin-top: 0 !important;
}

.markdown-body .admonition>*:last-child {
  margin-bottom: 0 !important;
}

/* progress bar*/
.markdown-body .progress {
  display: block;
  width: 300px;
  margin: 10px 0;
  height: 24px;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  background-color: #ededed;
  position: relative;
  box-shadow: inset -1px 1px 3px rgba(0, 0, 0, .1);
}

.markdown-body .progress-label {
  position: absolute;
  text-align: center;
  font-weight: bold;
  width: 100%; margin: 0;
  line-height: 24px;
  color: #333;
  text-shadow: 1px 1px 0 #fefefe, -1px -1px 0 #fefefe, -1px 1px 0 #fefefe, 1px -1px 0 #fefefe, 0 1px 0 #fefefe, 0 -1px 0 #fefefe, 1px 0 0 #fefefe, -1px 0 0 #fefefe, 1px 1px 2px #000;
  -webkit-font-smoothing: antialiased !important;
  white-space: nowrap;
  overflow: hidden;
}

.markdown-body .progress-bar {
  height: 24px;
  float: left;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  background-color: #96c6d7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -1px 0 rgba(0, 0, 0, .1);
  background-size: 30px 30px;
  background-image: -webkit-linear-gradient(
    135deg, rgba(255, 255, 255, .4) 27%,
    transparent 27%,
    transparent 52%, rgba(255, 255, 255, .4) 52%,
    rgba(255, 255, 255, .4) 77%,
    transparent 77%, transparent
  );
  background-image: -moz-linear-gradient(
    135deg,
    rgba(255, 255, 255, .4) 27%, transparent 27%,
    transparent 52%, rgba(255, 255, 255, .4) 52%,
    rgba(255, 255, 255, .4) 77%, transparent 77%,
    transparent
  );
  background-image: -ms-linear-gradient(
    135deg,
    rgba(255, 255, 255, .4) 27%, transparent 27%,
    transparent 52%, rgba(255, 255, 255, .4) 52%,
    rgba(255, 255, 255, .4) 77%, transparent 77%,
    transparent
  );
  background-image: -o-linear-gradient(
    135deg,
    rgba(255, 255, 255, .4) 27%, transparent 27%,
    transparent 52%, rgba(255, 255, 255, .4) 52%,
    rgba(255, 255, 255, .4) 77%, transparent 77%,
    transparent
  );
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, .4) 27%, transparent 27%,
    transparent 52%, rgba(255, 255, 255, .4) 52%,
    rgba(255, 255, 255, .4) 77%, transparent 77%,
    transparent
  );
}

.markdown-body .progress-100plus .progress-bar {
  background-color: #a6d796;
}

.markdown-body .progress-80plus .progress-bar {
  background-color: #c6d796;
}

.markdown-body .progress-60plus .progress-bar {
  background-color: #d7c896;
}

.markdown-body .progress-40plus .progress-bar {
  background-color: #d7a796;
}

.markdown-body .progress-20plus .progress-bar {
  background-color: #d796a6;
}

.markdown-body .progress-0plus .progress-bar {
  background-color: #c25f77;
}

.markdown-body .candystripe-animate .progress-bar{
  -webkit-animation: animate-stripes 3s linear infinite;
  -moz-animation: animate-stripes 3s linear infinite;
  animation: animate-stripes 3s linear infinite;
}

@-webkit-keyframes animate-stripes {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 60px 0;
  }
}

@-moz-keyframes animate-stripes {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 60px 0;
  }
}

@keyframes animate-stripes {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 60px 0;
  }
}

.markdown-body .gloss .progress-bar {
  box-shadow:
    inset 0 4px 12px rgba(255, 255, 255, .7),
    inset 0 -12px 0 rgba(0, 0, 0, .05);
}

/* Multimarkdown Critic Blocks */
.markdown-body .critic_mark {
  background: #ff0;
}

.markdown-body .critic_delete {
  color: #c82829;
  text-decoration: line-through;
}

.markdown-body .critic_insert {
  color: #718c00 ;
  text-decoration: underline;
}

.markdown-body .critic_comment {
  color: #8e908c;
  font-style: italic;
}

.markdown-body .headeranchor {
  font: normal normal 16px octicons-anchor;
  line-height: 1;
  display: inline-block;
  text-decoration: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.headeranchor:before {
  content: '\f05c';
}

.markdown-body .task-list-item {
  list-style-type: none;
}

.markdown-body .task-list-item+.task-list-item {
  margin-top: 3px;
}

.markdown-body .task-list-item input {
  margin: 0 4px 0.25em -20px;
  vertical-align: middle;
}

/* Media */
@media only screen and (min-width: 480px) {
  .markdown-body {
    font-size:14px;
  }
}

@media only screen and (min-width: 768px) {
  .markdown-body {
    font-size:16px;
  }
}

@media print {
  .markdown-body * {
    background: transparent !important;
    color: black !important;
    filter:none !important;
    -ms-filter: none !important;
  }

  .markdown-body {
    font-size:12pt;
    max-width:100%;
    outline:none;
    border: 0;
  }

  .markdown-body a,
  .markdown-body a:visited {
    text-decoration: underline;
  }

  .markdown-body .headeranchor-link {
    display: none;
  }

  .markdown-body a[href]:after {
    content: " (" attr(href) ")";
  }

  .markdown-body abbr[title]:after {
    content: " (" attr(title) ")";
  }

  .markdown-body .ir a:after,
  .markdown-body a[href^="javascript:"]:after,
  .markdown-body a[href^="#"]:after {
    content: "";
  }

  .markdown-body pre {
    white-space: pre;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  .markdown-body pre,
  .markdown-body blockquote {
    border: 1px solid #999;
    padding-right: 1em;
    page-break-inside: avoid;
  }

  .markdown-body .progress,
  .markdown-body .progress-bar {
    -moz-box-shadow: none;
    -webkit-box-shadow: none;
    box-shadow: none;
  }

  .markdown-body .progress {
    border: 1px solid #ddd;
  }

  .markdown-body .progress-bar {
    height: 22px;
    border-right: 1px solid #ddd;
  }

  .markdown-body tr,
  .markdown-body img {
    page-break-inside: avoid;
  }

  .markdown-body img {
    max-width: 100% !important;
  }

  .markdown-body p,
  .markdown-body h2,
  .markdown-body h3 {
    orphans: 3;
    widows: 3;
  }

  .markdown-body h2,
  .markdown-body h3 {
    page-break-after: avoid;
  }
}
</style><title>1234</title></head><body><article class="markdown-body"><h1 id="git"><a name="user-content-git" href="#git" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>Git  版本控制器</h1>
<h3 id="1git"><a name="user-content-1git" href="#1git" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>1.什么是Git</h3>
<blockquote>
<p>当今世界最先进/最好用的分布式版本控制系统,没有之一</p>
</blockquote>
<h3 id="2"><a name="user-content-2" href="#2" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>2.什么是版本控制系统?</h3>
<blockquote>
<h4 id="-"><a name="user-content--" href="#-" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>版本控制  &mdash; &lt;&lt;维基百科&gt;&gt;</h4>
<p>版本控制是一种软件工程技巧，能在软件开发的过程中，确保由不同人所编辑的同一代码文件案都得到同步.<br />
版本控制能使项目的设计者，将项目恢复到之前任意的状态，这种选择权在设计过程中特别重要.<br />
理论上所有的信息记录都可以加上版本控制:利用版本控制来追踪、维护源码、文件以及配置文件等等的改动</p>
</blockquote>
<hr />
<h3 id="3"><a name="user-content-3" href="#3" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>3.版本控制发展史</h3>
<h5 id="31"><a name="user-content-31" href="#31" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>3.1 文件名方式</h5>
<p>早年的软件开发过程，代码管理以手动和邮件等形式，文件命名及保存存在问题</p>
<p>如图 : 毕业论文版本<br />
<img src="./imgs/01.jpg" title="文件名控制版本"></p>
<h5 id="32"><a name="user-content-32" href="#32" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>3.2 集中式</h5>
<p>包括库和工作区两部分：工作区编码，再上传至库的方式完成多人协作。<br />
问题：工作机与库机需要联网才能控制版本，传输速度较慢。<br />
<img src="./imgs/02.png" title="集中式版本控制"></p>
<h5 id="32_1"><a name="user-content-32_1" href="#32_1" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>3.2 分布式</h5>
<p>每台电脑都有工作区和库自己控制版本，数据更加安全，有逻辑上的中心。<br />
<img src="./imgs/03.png" title="分布式版本控制"></p>
<hr />
<h3 id="4"><a name="user-content-4" href="#4" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>4.常见版本控制系统</h3>
<blockquote>
<p>图 : 版本管理器的发展史  </p>
</blockquote>
<p><img src="./imgs/04.png" width="80%" title="版本管理器的发展史"></p>
<blockquote>
<p>这张图上分成了四个时期 :</p>
<p>● 史前时期：1982年的RCS。现在你可能还能在Unix的发布包中找到它。</p>
<p>● 古典时期：1990年的CVS自身缺陷已经过时；1985年的PVCS、1992年的clearcase（费用昂贵、功能复杂沿用至今）；微软VVS反人类；Perforace（广泛，谷歌内部最大代码管理器）</p>
<p>● 中世纪时期：SVN解决了CVS的问题，集中式领域王者。AccuRev（支持分支合并让很多公司拜托cvs和clearcase）。</p>
<p>● 文艺复兴：BitKeeper（SUN公司大量使用），2002年Linux内核使用BitKeeper，2005年闭源时有人试图破解BitKeeper，于是出现了Git。</p>
</blockquote>
<h4 id="git_1"><a name="user-content-git_1" href="#git_1" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>Git问世</h4>
<p>Git的第一个版本是Linux之父Linus Torvalds亲手操刀设计和实现的（两周内用C写完），Linus不仅仅给出一个原始设计，并在向世人介绍Git时强烈批评了CVS和SVN等，Git消除了分支和合并的恐惧。很多大型开源项目由SVN迁移至Git。</p>
<p>2008年www.github.com也成为世界最大的SCM系统(软件配置管理)，它使用的就是Git版本库的技术.从此Git成为版本控制系统的主流。</p>
<p>GitHub上的著名项目 :<br />
Linux内核、安卓、jQuery、Bootstrap、Ruby &hellip;</p>
<hr />
<h3 id="5git"><a name="user-content-5git" href="#5git" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>5.Git的安装 和 基本配置</h3>
<h4 id="51"><a name="user-content-51" href="#51" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>5.1 安装</h4>
<blockquote>
<p>Linux安装  </p>
<blockquote>
<p>二进制包（在线）<br />
 yum -y install git  //RedHat系列<br />
 apt-get git install     //Debian系列<br />
 源码包（官网下载）</p>
</blockquote>
<p>Windows安装  </p>
<blockquote>
<p>Git在Windows使用模拟环境msysgit<br />
 下载地址：<br />
<a href="https://git-for-windows.github.io/"><a href="https://git-for-windows.github.io/"><a href="https://git-for-windows.github.io/">https://git-for-windows.github.io/</a></a></a><br />
 注意：如果想让windows作为git服务器则需要搭建ssh服务。</p>
</blockquote>
</blockquote>
<hr />
<blockquote>
<h4 id="windows"><a name="user-content-windows" href="#windows" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>本教程使用windows版本来做演示:</h4>
</blockquote>
<p>安装步骤: </p>
<p>1.选择安装路径<br />
<img src="./imgs/git01.png" width="50%"><br />
2.选择创建图标,选择安装Git Bash和Git GUI<br />
<img src="./imgs/git02.png" width="50%"></p>
<p>3.选择创建开始菜单<br />
<img src="./imgs/git03.png" width="50%"><br />
4.选择:use git and optional unix tools from the windows command prompt(红字提示)<br />
<img src="./imgs/git04.png" width="50%">  </p>
<p>5.选择: windows-style<br />
<img src="./imgs/git05.png" width="50%"><br />
6.选择 : use mintty  默认终端<br />
<img src="./imgs/git06.png" width="50%">  </p>
<p>7.选择 : 系统文件缓存 和 git的管理器(需要.net v4.5.1)<br />
<img src="./imgs/git07.png" width="50%"><br />
8.点击 Install 安装<br />
<img src="./imgs/git08.png" width="50%"><br />
9.安装完成,选择运行git bash工具</p>
<hr />
<h4 id="52"><a name="user-content-52" href="#52" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>5.2 配置</h4>
<blockquote>
<p>无论Linux还是Windows，安装完成后都要初始化<br />
<pre><code>git config [--global] user.name &quot;Your Name&quot;
git config [--global] user.email &quot;your@email.com&quot;

中括号内的参数:
    --local 本地
    --system 系统
    --global 全局
    无参,则为当前库配置身份
</code></pre></p>
</blockquote>
<h3 id="6-git"><a name="user-content-6-git" href="#6-git" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>6. Git常用操作</h3>
<h4 id="61"><a name="user-content-61" href="#61" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>6.1. 生成新的版本库</h4>
<ol>
<li>新建空目录</li>
<li>进入该目录&mdash;单击右键&mdash;选择Git Bash Here</li>
<li>弹出git的命令行工具</li>
<li>初始化该目录为版本仓库,键入 <code>git init</code></li>
<li>显示 Initialized empty Git repository in xxxxxx</li>
<li><code>ls -a</code> 查看该目录下出现.git的隐藏目录,即版本库</li>
<li>初始化完成</li>
</ol>
<h4 id="62"><a name="user-content-62" href="#62" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>6.2.添加文件到版本库</h4>
<ol>
<li>
<p>新建文件 <code>1.txt</code></p>
</li>
<li>
<p>查看当前版本状态</p>
<pre><code>git status     #查看当前版本状态
</code></pre>
</li>
<li>
<p>红字提示有文件未跟踪(未加入版本控制)</p>
</li>
<li>
<p>在工具内输入以下,添加文件至版本库:</p>
<pre><code>git add 1.txt
# 添加文件至缓存区
git commit -m "描述"
# 提交文件至版本库

git add newfile1 newfile2 ...
# 多文件添加
git commit -m "描述"
# 将缓存区的多次添加一次提交

ps:
git add .
# 添加所有改动过的文件到缓存区
git add --all
# 添加所有文件到缓存区
</code></pre>
</li>
<li>
<p>执行完后,提示提交完成.</p>
</li>
<li>
<p><code>git status</code> 提示<br />
nothing to commit, working directory clean</p>
</li>
<li>
<p>至此最简单的添加文件到版本库已完成</p>
</li>
</ol>
<hr />
<h4 id="-ps-git-"><a name="user-content--ps-git-" href="#-ps-git-" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a><center>&mdash; PS部分: Git 实现原理 &mdash;</center></h4>
<ol>
<li>工作区 : 就是程序员日常编写代码的文件夹</li>
<li>版本库 : 负责代码版本控制，就是.git隐藏目录</li>
<li>版本库原理图 :</li>
</ol>
<p><img src="./imgs/05.png"></p>
<p>版本库包括：暂存区（index/stage），HEAD（指针），分支（默认为master主分支）等。</p>
<p>文件提交至版本库总共分两步：<br />
1).<code>git add filename</code> # 添加至stage缓存区<br />
2).<code>git commit -m "描述"</code> # 将stage的内容提交至版本库的master分支</p>
<p>实验：<br />
修改文件-&gt;查看状态-&gt;<br />
添加到缓存区-&gt;查看状态-&gt;<br />
再次修改-&gt;提交-&gt;查看状态</p>
<p>查看区别:<br />
1). 修改文件-&gt;查看状态 : 显示红字,文件没在缓存区(工作区修改,还没有提交到缓存区)<br />
2). 添加到缓存区<code>git add .</code> -&gt; 查看状态 : 显示绿字,已提交到缓存区<br />
3). 继续修改文件-&gt;<code>git commit -m "第1次修改 1.txt"</code> -&gt; 再次查看状态 : 显示红字:文件有更改未加入到版本库</p>
<p>4). 这次提交,只是提交了add到缓存区的内容,第二次修改的内容并没有add到缓存区,所以版本库与工作区文件不一致.<br />
5). 此时需要将当前的文件add到缓存区,再次提交即可</p>
<h4 id="-ps-"><a name="user-content--ps-" href="#-ps-" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a><center>&mdash; PS.部分结束 &mdash;<center></h4>
<hr />
<h4 id="63"><a name="user-content-63" href="#63" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>6.3.查看文件修改状态相关</h4>
<pre><code>git status
# 查看当前版本状态（是否修改）
</code></pre>

<p>修改文件测试以下 :<br />
<pre><code>git diff
# 查看所有添加到缓存区的变更(工作区与版本库的区别)
git diff index.php
# 查看工作区文件和库文件区别
git diff --cached
# 查看所有已添加到缓存区,但还未commit的变更(缓存区与版本库的区别)
</code></pre></p>
<p>Git日志,分析日志构成 :</p>
<pre><code>git log
# 查看提交历史
git log --oneline
# 以简短的方式查看提交日志
</code></pre>

<hr />
<h4 id="64"><a name="user-content-64" href="#64" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>6.4. 版本回退</h4>
<pre><code>git reset --hard HEAD
# 将当前版本重置为HEAD（通常用于清空缓存区,或merge失败回退）

git reset --hard HEAD^   # 回退上一个版本
git reset --hard HEAD^^  # 回退上两个版本
git reset --hard HEAD~n  # 回退上n个版本

git reset --hard &lt;commitid&gt;
# 回退到指定版本，commitid根据log获取
</code></pre>

<hr />
<h4 id="65"><a name="user-content-65" href="#65" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>6.5. 行为日志</h4>
<pre><code>git reflog
# 行为日志,显示所有提交,回滚等..
git ls-files
# 显示缓存区的所有文件
</code></pre>

<hr />
<h4 id="66"><a name="user-content-66" href="#66" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>6.6. 撤销</h4>
<blockquote>
<p>目的：将尚未提交至版本库的修改撤回。</p>
</blockquote>
<ul>
<li>情况一 : 文件修改后尚未添加至缓存区<br />
<pre><code>git checkout --filename
# 在工作区撤销文件的修改
</code></pre></li>
<li>情况二 : 文件修改已添加至缓存区<br />
<pre><code>git checkout HEAD [filename]
# 撤回添加至缓存区的修改,不指定filename则撤回所有
</code></pre></li>
</ul>
<hr />
<h4 id="67"><a name="user-content-67" href="#67" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>6.7. 删除</h4>
<pre><code>git rm index.php
# 删除index.php文件
git rm --cached index.php
# 将index.php文件移出缓存区,但不删除( -r * 递归目录)
git rm -f 1.html
# 将缓存区中的1.html文件移出并删除
</code></pre>

<hr />
<h3 id="7-git"><a name="user-content-7-git" href="#7-git" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>7. Git多人协作</h3>
<h4 id="71"><a name="user-content-71" href="#71" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>7.1. 得到远程的版本库</h4>
<blockquote>
<p>可以使用两种方式来得到远程版本库:</p>
</blockquote>
<ul>
<li>在某个指定的文件夹下使用,即可得到远端版本库及代码<br />
<pre><code>git clone &lt;远端版本库url&gt; &lt;本地存放该库的文件夹名&gt;
</code></pre></li>
<li>手动添加版本库,并拉取文件<br />
<pre><code>git init
#初始化本地仓库

git remote add &lt;remote&gt; &lt;url&gt;
# 添加远程版本库 &lt;remote&gt;可自行取名,默认origin

git remote -v
# 查看远程版本库信息
git remote show &lt;remote&gt;
# 查看指定远程版本库信息

git pull &lt;remote&gt; &lt;branch&gt;
# 下载代码及快速合并
</code></pre></li>
</ul>
<hr />
<h4 id="72"><a name="user-content-72" href="#72" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>7.2. 推送分支代码</h4>
<p>得到远端版本库后,可以在本地按正常的步骤编辑 :<br />
新建或改动文件&ndash;&gt;添加至缓存区&ndash;&gt;提交到版本库</p>
<p>此时,要想将本地版本库发给远端,只有commit提交是不够的.<br />
还需要下面的操作 :<br />
<pre><code>git push &lt;remote&gt; &lt;branch&gt;
# 上传代码及快速合并
</code></pre><br />
执行以上代码,会有报错 : 无法直接推送到远端的主分支</p>
<p>此时,可以曲线救国,推送自己的分支到远端即可 :<br />
<pre><code>git push origin master:dev
</code></pre><br />
此时,推送成功!</p>
<hr />
<h3 id="8git"><a name="user-content-8git" href="#8git" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>8.Git分支管理</h3>
<h4 id="81"><a name="user-content-81" href="#81" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>8.1. 查看版本库分支</h4>
<pre><code>git branch
# 显示本地分支
git branch -a
# 显示所有分支
git checkout 分支名/标签名
# 切换到指定分支或标签
</code></pre>

<h4 id="82"><a name="user-content-82" href="#82" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>8.2. 创建分支/删除分支</h4>
<pre><code>git branch 分支名
# 新建分支
git checkout -b dev
# 创建并切换到dev分支

git branch -d 分支名
# 删除本地分支 -D 强制删除
</code></pre>

<h4 id="83"><a name="user-content-83" href="#83" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>8.3. 合并分支</h4>
<p>要将B分支合并到A分支里<br />
请切换到A分支内,合并B分支的操作在A分支内进行</p>
<pre><code>git merge 分支名
# 合并分支到当前分支 
</code></pre>

<h4 id="84"><a name="user-content-84" href="#84" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>8.4. 解决合并冲突</h4>
<blockquote>
<p>多分支修改同一文件，合并可能出现冲突。冲突部分用&lt;&lt;&lt;===&gt;&gt;&gt;表示</p>
</blockquote>
<p><img src="./imgs/06.png"></p>
<p>解决方法：<br />
先手动修改冲突部分，再次提交即可。</p>
<hr />
<h4 id="85"><a name="user-content-85" href="#85" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>8.5. 分支管理策略</h4>
<p><img src="./imgs/07.png"></p>
<hr />
<h3 id="9"><a name="user-content-9" href="#9" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>9. 使用代码托管系统</h3>
<p>市面上有名的Git托管系统 :</p>
<ul>
<li>GitHub  <a href="https://github.com/">https://github.com/</a></li>
<li>开源中国 <a href="https://git.oschina.net/">https://git.oschina.net/</a></li>
</ul>
<p>以下以开源中国为例,来学习使用</p>
<h4 id="91-ssh"><a name="user-content-91-ssh" href="#91-ssh" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>9.1. 本地生成SSH密钥</h4>
<p>1). 本地打开git bash ,<code>cd</code>切换到用户的家目录<br />
2). 使用<code>pwd</code>来查看目录是否正确<br />
3). 使用 <code>ssh-keygen.exe -t rsa</code> 来生成SHA256的SSH密钥(按回车确认即可)<br />
4). <code>cd .ssh/</code> 切换至ssh目录<br />
5). <code>ls</code> 查看目录下文件<br />
6). <code>cat id_rsa.pub</code> 查看生成的密钥,并复制</p>
<p>7). 打开git@osc开源中国,登录自己的账户.点选个人资料<br />
8). 选择SSH公钥<br />
9). 在添加公钥界面,将刚刚复制好的密钥粘贴进来,再自己取一个该密钥的名字,以便于区分管理</p>
<p>10). 本地新建一个目录,用于拉取远端版本库<br />
11). 使用 <code>git init</code>初始化该目录<br />
12). 使用<code>git remote add origin &lt;SSH地址&gt;</code> 来添加远程版本库</p>
<p>13). 使用<code>git remote -v</code> 来查看远程版本库信息<br />
14). 使用<code>git pull origin marster</code>来拉取版本库及代码</p>
<hr />
<blockquote>
<h3 id="git_2"><a name="user-content-git_2" href="#git_2" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>Git常用命令速查</h3>
</blockquote>
<ul>
<li>master 默认主分支</li>
<li>dev 默认开发分支</li>
</ul>
<blockquote>
<p>创建版本库</p>
</blockquote>
<pre><code>git init
# 初始化本地git版本库（创建新仓库）

git config --global user.name &quot;xxx&quot;
# 配置用户名

git config --global user.email &quot;xxx@xxx.com&quot;
# 配置邮件

git config --list
#查看当前配置列表

git clone &lt;url&gt;
# clone远程仓库
</code></pre>

<blockquote>
<p>修改、提交、删除</p>
</blockquote>
<pre><code>git add index.php
# 添加index.php文件到缓存区
git add .
# 添加所有改动过的文件到缓存区
git add --all
# 添加所有文件到缓存区

git commit
# 提交缓存区内的文件(回车后需要键入描述:wq保存退出)
git commit -m &quot;描述&quot;
# 提交缓存区内的文件,并提供描述

git commit -am '描述'
# 将add和commit合为一步
git commit --amend -m 'xxx'
# 合并最后一次提交(用于反复修改)

git rm index.php
# 删除index.php文件
git rm --cached index.php
# 将index.php文件移出缓存区,但不删除( -r * 递归目录)
git rm -f 1.html
# 将缓存区中的1.html文件移出并删除
</code></pre>

<blockquote>
<p>查看</p>
</blockquote>
<pre><code>git status
# 查看当前版本状态（是否修改）

git diff
# 查看所有添加到缓存区的变更(工作区与版本库的区别)
git diff index.php
# 查看工作区文件和库文件区别
git diff --cached
# 查看所有已添加到缓存区,但还未commit的变更(缓存区与版本库的区别)

git log
# 查看提交历史
git log --oneline
# 以简短的方式查看提交日志

git reflog
# 行为日志,显示所有提交,回滚等..
git ls-files
# 显示缓存区的所有文件
</code></pre>

<blockquote>
<p>回退 与 撤销</p>
</blockquote>
<pre><code>git reset --hard HEAD
# 将当前版本重置为HEAD（通常用于merge失败回退）

git reset --hard HEAD^   # 回退上一个版本
git reset --hard HEAD^^  # 回退上两个版本
git reset --hard HEAD~n  # 回退上n个版本

git reset --hard &lt;commitid&gt;
# 回退指定版本，commitid根据log获取

git checkout --filename
# 在工作区撤销文件的修改
git checkout HEAD [filename]
# 撤回添加至缓存区的修改,不指定filename则撤回所有
</code></pre>

<blockquote>
<p>分支操作</p>
</blockquote>
<pre><code>git pull origin master
# 获取远程分支master并merge到当前分支

git branch
# 显示本地分支
git branch -a
# 显示所有分支
git checkout 分支名/标签名
# 切换到指定分支或标签

git branch 分支名
# 新建分支
git branch -d 分支名
# 删除本地分支 -D 强制删除
</code></pre>

<blockquote>
<p>远程协作</p>
</blockquote>
<pre><code>git remote add &lt;remote&gt; &lt;url&gt;
# 添加远程版本库
git remote -v
# 查看远程版本库信息
git remote show &lt;remote&gt;
# 查看指定远程版本库信息
git remote remove &lt;name&gt;
# 删除远程remote链接
git remote rename &lt;old&gt; &lt;new&gt;
# 重命名远程链接名

git pull &lt;remote&gt; &lt;branch&gt;
# 下载代码及快速合并

git push &lt;remote&gt; &lt;branch&gt;
# 上传代码及快速合并

git merge origin master
# 将本地的远端库合并

git fetch origin
# 将远端库获取本地但不合并
</code></pre></article></body></html>